<?php defined('InNcPHP') or exit('Access Invalid!');?>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3><?php echo $lang['type_index'];?></h3>
      <?php echo $output['top_link'];?>
    </div>
  </div>
  <div class="fixed-empty"></div>
    <table class="table tb-type2" id="prompt">
        <tbody>
        <tr class="space odd">
            <th class="nobg" colspan="12"><div class="title"><h5><?php echo $lang['nc_prompts'];?></h5><span class="arrow"></span></div></th>
        </tr>
        <tr>
            <td>
                <ul>
                    <li>该票券为门票的票券类型例如：儿童票,成人票</li>
                </ul></td>
        </tr>
        </tbody>
    </table>
  <form>
    <table class="table tb-type2">

      <thead>
        <tr class="thead">
          <th><?php echo $lang['type_name'];?></th>
          <th><?php echo $lang['type_desc'];?></th>
          <th><?php echo $lang['nc_handle'];?></th>
        </tr>
      </thead>
      <tbody>
      <?php if (!empty($output['lists']) && is_array($output['lists'])) { ?>
          <?php foreach ($output['lists'] as $k => $v) { ?>
          <tr>
              <td><?php echo $v['type_name'];?></td>
              <td><?php echo $v['type_desc'];?></td>
              <td>
                  <a href="index.php?act=ticket_type&op=edit&id=<?php echo $v['type_id'];?>"><?php echo $lang['nc_edit'];?></a>
                  <a href="javascript:;" onclick="delType(<?php echo $v['type_id'];?>)"><?php echo $lang['nc_del'];?></a>
              </td>
          </tr>
          <?php } ?>
      <?php } else { ?>
          <tr class="no_data">
              <td colspan="10"><?php echo $lang['nc_no_record'];?></td>
          </tr>
      <?php } ?>
      </tbody>
        <tfoot class="tfoot">
        <?php if(!empty($output['lists']) && is_array($output['lists'])){ ?>
            <tr>
                <td colspan="16">
                    <div class="pagination"> <?php echo $output['page'];?> </div>
                </td>
            </tr>
        <?php } ?>
        </tfoot>
    </table>
  </form>
</div>
<script>
    //删除票券
    function delType(id)
    {
        layer.confirm('是否删除该票券类型?(删除将导致所有门票底下的此票券下架,请谨慎操作！)', {
            btn: ['<?php echo $lang['nc_yes']; ?>', '<?php echo $lang['nc_no']; ?>']
        }, function (index) {
            location.href='index.php?act=ticket_type&op=del&id=' + id;
        });
    }
</script>
